package edu.washington.tcss360.burningpenguins.BPGUI;

import java.awt.BorderLayout;
import java.util.Observable;
import java.util.Observer;

import javax.swing.JFrame;

import edu.washington.tcss360.burningpenguins.data.Role;

/**
 * Provides the basic frame of the GUI.
 * 
 * @author Sean
 * @version 1
 * @since 11/19/2013
 */
public class BPFrame extends JFrame implements Observer {
	// TODO: put current active role in this scope, pass information down to components as needed.

	/**
	 * Enables serializing of this object.
	 */
	private static final long serialVersionUID = 5832555435646140685L;

	private static final int MY_MIN_HEIGHT = 600;
	
	private static final int MY_MIN_WIDTH = 850;
	
	private int my_role;
	
	/**
	 * For testing purposes with menus.
	 */
	private static final int SUPER_ROLE = 5;
	
	public BPFrame(final int h, final int w) {
		super("Burning Penguins Conference Manager");
		this.my_role = Role.PROGRAM_CHAIR;
		this.setSize(w, h);
		this.setLayout(new BorderLayout());
		this.add(new BPContentPage(), BorderLayout.CENTER);
		BPSideBar buttons = new BPSideBar(my_role);
		this.add(buttons, BorderLayout.WEST);
		this.add(new BPHeader(my_role), BorderLayout.NORTH);
	}
	
	public BPFrame() {
		this(MY_MIN_HEIGHT, MY_MIN_WIDTH);
	}
	
	@Override
	public void update(Observable arg0, Object arg1) {
		// TODO Auto-generated method stub

	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		BPFrame frame = new BPFrame();
		frame.pack();
		frame.setVisible(true);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}

}
